package cn.zcf.downgrade;

import cn.zcf.domain.User;
import org.springframework.web.bind.annotation.PathVariable;

public class FuseDowngradeUtil {

    /*
     * @Description: 熔断降级方法
     * @Author: Director
     * @Date: 2022/7/31 1:50
     * @param id:
     * @param e: 降级异常
     * @return: cn.itsource.domain.User
     **/
    public static User fuseDegradation(@PathVariable("id") Long id, Throwable  e){
        e.printStackTrace();
        return new User(-1L, "熔断服务降级触发！", "服务不可用，请稍后重试！");
    }

}